<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <%- @view_title = "Edit Pipeline" -%>
  <%- @current_tab_name = "admin" -%>
  <%= render :partial => "shared/head" %>

  <%- unless (Rails.env.test?) %>
    <%= javascript_include_tag *webpack_assets_service.getJSAssetPathsFor("single_page_apps/show_template_modal_shim") %>
  <%- end %>
</head>
<body id="<%= page_name %>" class="<%= page_name %>" <%= render "shared/body_data_attrs" %>>
<div class="page-wrap">
  <div id="body_bg">

    <%= render :partial => "shared/header" %>

    <div id='body_content' class="admin_body_content">
      <div class="messaging_wrapper" id="messaging_wrapper">
        <%= render :partial => "shared/flash_message" %>
        <%= render :partial => "shared/config_save_actions", :locals => {:scope => {}} -%>
      </div>

      <%= render :partial => 'layouts/pipelines/breadcrumb_top' %>

      <%= content_wrapper_tag %>
      <div class="row">
        <div class="admin_wrapper">
          <div class="admin_sidebar general">
            <%= render :partial => "admin/shared/pipeline_tree.html", :locals => {:scope => {:pipeline => @pipeline}} %>
          </div>
          <div class="admin_workspace has_tree_view">
            <div class="pipeline_header">
              <h3 class="title entity_title">
                <%= link_to @pipeline.name(), pipeline_edit_path(:pipeline_name => params[:pipeline_name], :current_tab => 'general'), :class => 'wrapped_word' %>
              </h3>
            </div>
            <div class="sub_tabs_container <%= params[:current_tab] -%>">
              <%= render :partial => "admin/pipelines/pipeline_navigation", :locals => {:scope => {:pipeline => @pipeline}, :disabled => true} %>
            </div>

            <%= render :partial => "admin/shared/global_errors.html", :locals => {:scope => {}} -%>

            <%= yield %>

          </div>
        </div>
        <%- unless  @is_config_repo_pipeline %>
          <%= render :partial => "admin/shared/dirty_form", :locals => {:scope => {:form_id => 'pipeline_edit_form', :reset_id => "reset_form"}} %>
        <%- end %>
        <%= render :partial => 'shared/convert_tool_tips.html', :locals => {:scope => {}} %>
      </div>
      <%= end_content_wrapper %>
    </div>
  </div>
</div>
<%= render :partial => 'navigation_elements/footer' %>

</body>
<script type="text/javascript">
  jQuery(document).ready(function () {
    if (<%= @is_config_repo_pipeline || false %>) {
      Util.disableAllFormElementsFor(".admin_wrapper");
    }
  });

  AjaxRefreshers.addRefresher(new AjaxRefresher("<%= pause_info_refresh_path(:pipeline_name => @pipeline.name()) -%>"), true);
</script>
</html>
